package interview.anonymous;

public class Main {

    public void method1(Inner inner){
    inner.say();
    }

    public static void main(String[] args) {

        Main m = new Main();

      m.method1(new Inner() {
          @Override
          public void say() {
              System.out.println("inner");
          }
      });

       m.method1( new Inner1(){
           @Override
           public void say() {
               System.out.println("inner1");
           }
       });

       Inner2 inner2 = new Inner2(){
           @Override
           public void say() {
               System.out.println("inner2");
           }
       };
        m.method1(inner2);

    }
}
